***************************************************************************************************
********************* Lasse Laustsen, 2021; Advances in Political Psychology***********************
************* Candidate Evaluations through the Lens of Adaptive Followership Psychology **********
***************************************************************************************************

*************************** Recodings of used variables *******************************************

** Gender
clonevar gender = Q1
tab gender

** Age
generate age = 2020 - Q2
summ age
tab age


** Education
recode Q4 (1=1 "Primary school") (3 4=2 "Vocational training") (2=3 "High school") ///
(5=4 "short higher, edu.") (6 7=5 "medium higher, edu.") (8 9=6 "long higher edu.") (10 11=7 "other"), generate(education)


** Geography
tab Region
* Capital dummy
recode Region (1086 = 1) (1081 1082 1083 1085 =0), generate(Capital)


*** Perceived Corona Threat
recode Q6 (99=.)
generate Perc_CoronaThreat = Q6/10
summ Perc_CoronaThreat


*********************************************** Trait rating study ******************************************
*** Context condition (Corona vs. control condition)
generate Corona_1 =.
replace Corona_1 = 1 if Q16_Version == 2
replace Corona_1 = 1 if Q16_Version == 4
replace Corona_1 = 0 if Q16_Version == 1
replace Corona_1 = 0 if Q16_Version == 3

lab def CoronaLB 0 "Control condition" 1 "Corona condition"
lab val Corona_1 CoronaLB

*** Target condition (Prime Minister vs. colleague condition)
generate PrimeMinister =.
replace PrimeMinister = 1 if Q16_Version == 1
replace PrimeMinister = 1 if Q16_Version == 2
replace PrimeMinister = 0 if Q16_Version == 3
replace PrimeMinister = 0 if Q16_Version == 4

lab def PrimeMinisterLB 0 "Colleague" 1 "Prime Minister"
lab val PrimeMinister PrimeMinisterLB


***** Dependent variables: Rated trait importance
* Competence
egen competence = rowmean(Q16A_1_resp Q16B_1_resp Q16C_1_resp Q16D_1_resp)
generate Competence = (competence-1)/6
* Trustworthy
egen trustworthy = rowmean(Q16A_2_resp Q16B_2_resp Q16C_2_resp Q16D_2_resp)
generate Trustworthy = (trustworthy-1)/6
* Dominant
egen dominant = rowmean(Q16A_3_resp Q16B_3_resp Q16C_3_resp Q16D_3_resp)
generate Dominant = (dominant-1)/6
* Powerful
egen powerful = rowmean(Q16A_4_resp Q16B_4_resp Q16C_4_resp Q16D_4_resp)
generate Powerful = (powerful-1)/6
* Healthy
egen healthy = rowmean(Q16A_5_resp Q16B_5_resp Q16C_5_resp Q16D_5_resp)
generate Healthy = (healthy-1)/6
* Attractive
egen attractive = rowmean(Q16A_6_resp Q16B_6_resp Q16C_6_resp Q16D_6_resp)
generate Attractive = (attractive-1)/6


************************************** Face study ******************************************
*** Attractiveness condition for target (High vs Low attractiveness target)
generate High_Attractiveness =.
replace High_Attractiveness = 1 if Q20_Version == 1
replace High_Attractiveness = 1 if Q20_Version == 3
replace High_Attractiveness = 0 if Q20_Version == 2
replace High_Attractiveness = 0 if Q20_Version == 4

lab def High_AttractivenessLB 0 "Low Attractive target" 1 "High Attractive target"
lab val High_Attractiveness High_AttractivenessLB

*** Context condition (Corona vs. control condition)
generate Corona_2 =.
replace Corona_2 = 1 if Q20_Version == 3
replace Corona_2 = 1 if Q20_Version == 4
replace Corona_2 = 0 if Q20_Version == 1
replace Corona_2 = 0 if Q20_Version == 2

lab val Corona_2 CoronaLB

***** Dependent variable: Rated quality of target as Prime Minister
egen priminquality = rowmean(Q20A Q20B Q20C Q20D)
generate PriMinQuality = (priminquality-1)/6
summ PriMinQuality



***************************** Results reported for Disease Threat Problem *************************************
**************************************** Results from Rating study ********************************************
***** Descriptives and correlations for trait ratings
** Across targets
summ Attractive Health Dominant Powerful Competence Trustworthy
pwcorr Attractive Health Dominant Competence Powerful Trustworthy, sig
** For prime minister
summ Attractive Health Dominant Powerful Competence Trustworthy if PrimeMinister == 1
pwcorr Attractive Health Dominant Competence Powerful Trustworthy if PrimeMinister == 1, sig
** For colleague
summ Attractive Health Dominant Powerful Competence Trustworthy if PrimeMinister == 0
pwcorr Attractive Health Dominant Competence Powerful Trustworthy if PrimeMinister == 0, sig


***** Individual difference prediction analyses: Prediction of importance of attractiveness and health in prime minister
** Attractiveness
reg Attractive c.Perc_CoronaThreat i.Corona_1 i.gender c.age i.education i.Region if PrimeMinister == 1
est sto attractive
** Health
reg Health c.Perc_CoronaThreat i.Corona_1 i.gender c.age i.education i.Region if PrimeMinister == 1
est sto health
** Dominance
reg Dominant c.Perc_CoronaThreat i.Corona_1 i.gender c.age i.education i.Region if PrimeMinister == 1
est sto dominance
** Competence
reg Competence c.Perc_CoronaThreat i.Corona_1 i.gender c.age i.education i.Region if PrimeMinister == 1
est sto competence
** Power
reg Powerful c.Perc_CoronaThreat i.Corona_1 i.gender c.age i.education i.Region if PrimeMinister == 1
est sto power
** Trustworthy
reg Trustworthy c.Perc_CoronaThreat i.Corona_1 i.gender c.age i.education i.Region if PrimeMinister == 1
est sto trustworthiness


*** Tests if predictive power of self-preceived corona threat differs across trait ratings
suest attractive health dominance competence power trustworthiness

** For attractiveness vs. other traits
test [attractive_mean]Perc_CoronaThreat=[health_mean]Perc_CoronaThreat
test [attractive_mean]Perc_CoronaThreat=[dominance_mean]Perc_CoronaThreat
test [attractive_mean]Perc_CoronaThreat=[competence_mean]Perc_CoronaThreat
test [attractive_mean]Perc_CoronaThreat=[power_mean]Perc_CoronaThreat
test [attractive_mean]Perc_CoronaThreat=[trustworthiness_mean]Perc_CoronaThreat

** For health vs. other traits
test [health_mean]Perc_CoronaThreat=[attractive_mean]Perc_CoronaThreat
test [health_mean]Perc_CoronaThreat=[dominance_mean]Perc_CoronaThreat
test [health_mean]Perc_CoronaThreat=[competence_mean]Perc_CoronaThreat
test [health_mean]Perc_CoronaThreat=[power_mean]Perc_CoronaThreat
test [health_mean]Perc_CoronaThreat=[trustworthiness_mean]Perc_CoronaThreat



**************************************** Results from Face study ********************************************
***** Tests if perceived severity of the corona pandemic predicts prime minister ratings of low and high attractiveness target
* (reported in Table S.4.2 in Supplementary Materials)
reg PriMinQuality i.High_Attractiveness##c.Perc_CoronaThreat i.Corona_2 i.gender c.age i.education i.Region
margins, dydx(Perc_CoronaThreat) at(High_A=(0 1))



**************************************** Results from Rating study ********************************************
***** Distinctiveness Prediction: Does severity of the corona pandemic relate stronger to trait ratings in a prime minister than a colleague?

*** Generate results reported in Tabel Based on Test 1 (models reported in Table S.5 in the Supplementary Material): 
reg Attractive c.Perc_CoronaThreat##i.PrimeMinister i.Corona_1 i.gender c.age i.education i.Region
reg Health c.Perc_CoronaThreat##i.PrimeMinister i.Corona_1 i.gender c.age i.education i.Region

*** Generates Figure 5 in article:
reg Attractive c.Perc_CoronaThreat##i.PrimeMinister i.Corona_1 i.gender c.age i.education i.Region
margins, at(Perc_CoronaThreat=(.5 (.1) 1) PrimeMinister=(0 1))
marginsplot, recastci(rline) ciopts(lpattern(dash) lwidth(thin)) recast(line) plotopts(lwidth(mediumthin)) xtitle("Perceived COVID-19 Threat") yscale(range(0 1)) ylabel(0(.2)1,nogrid) ///
yline(0, lpattern(solid) lcolor(Black) lwidth(mediumthin)) ///
xscale(range(.5 1)) xlabel(.5(.1)1,nogrid) ytitle("Attractive Importance") title("Panel A: Attractiveness") legend(off) name(Attractiveness_Importance, replace)

reg Health c.Perc_CoronaThreat##i.PrimeMinister i.Corona_1 i.gender c.age i.education i.Region
margins, at(Perc_CoronaThreat=(.5 (.1) 1) PrimeMinister=(0 1))
marginsplot, recastci(rline) ciopts(lpattern(dash) lwidth(thin)) recast(line) plotopts(lwidth(mediumthin)) xtitle("Perceived COVID-19 Threat") yscale(range(0 1)) ylabel(0(.2)1,nogrid) ///
yline(0, lpattern(solid) lcolor(Black) lwidth(mediumthin))  ///
xscale(range(.5 1)) xlabel(.5(.1)1,nogrid) ytitle("Health Importance") title("Panel B: Healthy") legend(off) name(Health_Importance, replace)

* Figure 5
graph combine Attractiveness_Importance Health_Importance, col(2)
